package com.heima.wemedia.controller.v1;

import com.heima.model.comment.dtos.FansFollowDTO;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.UserFansPortDTO;
import com.heima.model.wemedia.dtos.WmStatisticsDTO;
import com.heima.wemedia.service.WmStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(value = "自媒体统计分析API", tags = "自媒体统计分析API")
@RequestMapping("/api/v1/user_fans")
public class WmUserFansController {
    @Autowired
    private WmStatisticsService wmStatisticsService;


    @GetMapping("/fans_portrait")
    @ApiOperation("粉丝画像")
    public ResponseResult userFans() {
        return wmStatisticsService.userFans();
    }

    @PostMapping("/list")
    @ApiOperation("粉丝列表")
    public ResponseResult list(@RequestBody UserFansPortDTO dto) {
        return wmStatisticsService.list(dto);
    }

    @PostMapping("/change_follow_state")
    @ApiOperation("粉丝关注")
    public ResponseResult changeFollowState(@RequestBody FansFollowDTO dto){
        return wmStatisticsService.changeFollowState(dto);
    }
}
